[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 getmoderange()          Return Mode Range for Specified Driver

 #include   <graphics.h>

 void *far  getmoderange(gdriver,lo,hi);
 int        gdriver;
 int far    *lo;
 int far    *hi;

    getmoderange() returns the range of graphics modes for the specified
    graphics driver 'gdriver'.  The lowest value is returned in 'lo' and
    the highest value in 'hi'. For more information about the graphics
    driver types and graphics modes, see the two lists in initgraph(). If
    an invalid graphics driver is specified, both 'lo' and 'hi' are set
    to -1.

    Returns:    Nothing.

   -------------------------------- Example ---------------------------------

    The following statements initialize the graphics system and get the
    graphics mode range.  If the mode is within the legitimate range,
    graphics operations are performed.

           #include <graphics.h>
           #include <stdio.h>

           main()
           {
               int gdriver = DETECT;
               int gmode, cmode;
               int *lo, *hi;

               initgraph(&gdriver,&gmode,"");
               getmoderange(gdriver,&lo,&hi);
               printf("driver #%d mode range: %d - %d\n",gdriver,lo,hi);
               cmode = getgraphmode();
               if (cmode >= lo && cmode <= hi) {
                   printf("mode %d is within bounds\n",cmode);
                  /* graphics operations*/
               }
               closegraph();
           }


See Also: initgraph() getgraphmode()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson